package kr.ac.kongju.gedl.item.vo;

import java.io.Serializable;

import org.apache.commons.lang.StringUtils;

import kr.ac.kongju.gedl.cmmn.vo.CommonVO;



public class ItemLevelVO  extends CommonVO{
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -1894681527908099763L;
	
	private String levelId="";            //아이템레벨ID
	private String xmlId="";          //아이템XML_ID
	private ItemInfoVO itemInfo=new ItemInfoVO();          //아이템ID
	private String level="";              //아이템레벨
	private String parentId="";           //상위ID
	private String sequence="";           //순서
	private String types="";              //구분 [원문|번역|표점]                      ???]
	private String mainTitle="";          //제목
	private String alternative="";        //대체자료명
	private String seriesTitle="";        //게제자(연구자료)                           ??)
	private String period="";             //시대
	private String author="";             //저자(연구자료)                             )
	private String reference="";          //출전(유물유적)                             ?)
	private String form="";               //형태
	private String subjectClass="";       //주제
	private String dates="";              //발송일 dateSend | dateOccured | dateCreatednd | dateOccured | dateCreated
	private String creator="";            // 발송자 sender | creator                   r | creator
	private String publisher="";          //제작자
	private String place="";              //제작국
	private String binder="";             //편철기관(법령)
	private String nation="";             //국가 subjectClass@schema 국가명            Class@schema ??????
	private String linkUrl="";            //링크Url
	private String linkText="";           //링크Text
	private String biblioExplanation="";  //해제  biblioExplanation                    Explanation
	private String existImage="";         //이미지존재여부(뷰어용)
	private String otherTypes="";         //관련자료의 원문|번역|표점 유형 정보
	private String isLeaf="";             //마지막여부
	private String isText="";             //본문여부
	private String levelXml="";           //레벨XML
	private String registedDate="";       //등록일
	private String register="";           //등록자
	private String modifiedDate="";       //최종수정일
	private String modifier = "";         //최종수정자
	
	private int imageCount = 0;         //이미지수
	private int gisCount = 0;         //GIS수
	private int count = 0;				//통계결과치
	private String levelText = "";		//본문 Xls 결과
	
	//************************************검색엔진 섹션값
	private String doc_id = "";			//검색엔진ID
	private String document = "";
	private String levelId1 = "";
	private String mainTitle1 = "";
	private String levelId2 = "";
	private String mainTitle2 = "";
	private String levelId3 = "";
	private String mainTitle3 = "";
	private String levelId4 = "";
	private String mainTitle4 = "";
	private String levelId5 = "";
	private String mainTitle5 = "";
	private String levelId6 = "";
	private String mainTitle6 = "";
	
	private String indexPlace="";
	private String indexName="";
	private String indexGover="";
	private String indexOfficial="";
	private String indexDoc="";
	private String indexGroup="";
	private String indexEvent="";
	private String indexBook="";
	private String indexLaw="";
	private String indexEtc="";
	private int position = -1;
	
	
	public String getLevelId1() {
		return levelId1;
	}
	public void setLevelId1(String levelId1) {
		this.levelId1 = levelId1;
	}
	public String getMainTitle1() {
		return mainTitle1;
	}
	public void setMainTitle1(String mainTitle1) {
		this.mainTitle1 = mainTitle1;
	}
	public String getLevelId2() {
		return levelId2;
	}
	public void setLevelId2(String levelId2) {
		this.levelId2 = levelId2;
	}
	public String getMainTitle2() {
		return mainTitle2;
	}
	public void setMainTitle2(String mainTitle2) {
		this.mainTitle2 = mainTitle2;
	}
	public String getLevelId3() {
		return levelId3;
	}
	public void setLevelId3(String levelId3) {
		this.levelId3 = levelId3;
	}
	public String getMainTitle3() {
		return mainTitle3;
	}
	public void setMainTitle3(String mainTitle3) {
		this.mainTitle3 = mainTitle3;
	}
	public String getLevelId4() {
		return levelId4;
	}
	public void setLevelId4(String levelId4) {
		this.levelId4 = levelId4;
	}
	public String getMainTitle4() {
		return mainTitle4;
	}
	public void setMainTitle4(String mainTitle4) {
		this.mainTitle4 = mainTitle4;
	}
	public String getLevelId5() {
		return levelId5;
	}
	public void setLevelId5(String levelId5) {
		this.levelId5 = levelId5;
	}
	public String getMainTitle5() {
		return mainTitle5;
	}
	public void setMainTitle5(String mainTitle5) {
		this.mainTitle5 = mainTitle5;
	}
	public String getIndexPlace() {
		return indexPlace;
	}
	public void setIndexPlace(String indexPlace) {
		this.indexPlace = indexPlace;
	}
	public String getIndexName() {
		return indexName;
	}
	public void setIndexName(String indexName) {
		this.indexName = indexName;
	}
	public String getIndexGover() {
		return indexGover;
	}
	public void setIndexGover(String indexGover) {
		this.indexGover = indexGover;
	}
	public String getIndexOfficial() {
		return indexOfficial;
	}
	public void setIndexOfficial(String indexOfficial) {
		this.indexOfficial = indexOfficial;
	}
	public String getIndexDoc() {
		return indexDoc;
	}
	public void setIndexDoc(String indexDoc) {
		this.indexDoc = indexDoc;
	}
	public String getIndexGroup() {
		return indexGroup;
	}
	public void setIndexGroup(String indexGroup) {
		this.indexGroup = indexGroup;
	}
	public String getIndexEvent() {
		return indexEvent;
	}
	public void setIndexEvent(String indexEvent) {
		this.indexEvent = indexEvent;
	}
	public String getIndexBook() {
		return indexBook;
	}
	public void setIndexBook(String indexBook) {
		this.indexBook = indexBook;
	}
	public String getIndexLaw() {
		return indexLaw;
	}
	public void setIndexLaw(String indexLaw) {
		this.indexLaw = indexLaw;
	}
	public String getIndexEtc() {
		return indexEtc;
	}
	public void setIndexEtc(String indexEtc) {
		this.indexEtc = indexEtc;
	}
	
	public String getDocument() {
		return document;
	}
	public void setDocument(String document) {
		this.document = document;
	}
	public String getLevelId6() {
		return levelId6;
	}
	public void setLevelId6(String levelId6) {
		this.levelId6 = levelId6;
	}
	
	public String getMainTitle6() {
		return mainTitle6;
	}
	public void setMainTitle6(String mainTitle6) {
		this.mainTitle6 = mainTitle6;
	}
	//*****************************end 검색엔진 섹션값
	public ItemLevelVO() {
		super();
	}
	public ItemLevelVO(String levelId) {
		super();
		this.levelId = levelId;
	}
	public ItemLevelVO(ItemInfoVO itemInfo) {
		super();
		this.itemInfo = itemInfo;
	}
	public String getLevelId() {
		return levelId;
	}
	public void setLevelId(String levelId) {
		this.levelId = levelId;
	}
	public String getXmlId() {
		return xmlId;
	}
	public void setXmlId(String xmlId) {
		this.xmlId = xmlId;
	}
	public ItemInfoVO getItemInfo() {
		return itemInfo;
	}
	public void setItemInfo(ItemInfoVO itemId) {
		this.itemInfo = itemId;
	}
	public String getLevel() {
		return level;
	}
	public void setLevel(String level) {
		this.level = level;
	}
	public String getParentId() {
		return parentId;
	}
	public void setParentId(String parentId) {
		this.parentId = parentId;
	}
	public String getSequence() {
		return sequence;
	}
	public void setSequence(String sequence) {
		this.sequence = sequence;
	}
	public String getTypes() {
		return types;
	}
	public void setTypes(String types) {
		this.types = types;
	}
	public String getMainTitle() {
		return mainTitle;
	}
	public void setMainTitle(String mainTitle) {
		this.mainTitle = mainTitle;
	}
	public String getAlternative() {
		return alternative;
	}
	public void setAlternative(String alternative) {
		this.alternative = alternative;
	}
	public String getSeriesTitle() {
		return seriesTitle;
	}
	public void setSeriesTitle(String seriesTitle) {
		this.seriesTitle = seriesTitle;
	}
	public String getPeriod() {
		return period;
	}
	public void setPeriod(String period) {
		this.period = period;
	}
	public String getAuthor() {
		return author;
	}
	public void setAuthor(String author) {
		this.author = author;
	}
	public String getReference() {
		return reference;
	}
	public void setReference(String reference) {
		this.reference = reference;
	}
	public String getForm() {
		return form;
	}
	public void setForm(String form) {
		this.form = form;
	}
	public String getSubjectClass() {
		return subjectClass;
	}
	public void setSubjectClass(String subjectClass) {
		this.subjectClass = subjectClass;
	}
	public String getDates() {
		return dates;
	}
	public void setDates(String dates) {
		this.dates = dates;
	}
	//목록다운로드시 출력일자형식반환
	public String getDatesFormat() {
		String date = this.dates;
		if(!StringUtils.isEmpty(date)){
			//기원전 처리
			String bc = "";
			if(date.startsWith("-")){
				bc = "기원전";
				date = date.substring(1);
			}
			//년월일분리
			String year = date.substring(0, date.indexOf("-"));
			String mon = date.substring(date.indexOf("-")+1, date.lastIndexOf("-"));
			String day = date.substring(date.lastIndexOf("-")+1, date.lastIndexOf("-")+3);
			String l = date.substring(date.length()-2);
			
			//음력/윤달처리
			if(!day.equals(l) && l.endsWith("1")){
				l = "(윤)";
			}else if(!day.equals(l) && l.startsWith("L")){
				l = "(음)";
			}else{
				l = "";
			}
			//년도 미상처리
			if(year.startsWith("9") && mon.startsWith("9") && day.startsWith("9")){
				year = "미상";
				l = "";
			}else if(year.startsWith("9") && mon.startsWith("9")){
				year = "년월 미상";
			}else if(year.startsWith("9")){
				year = "년도 미상";
			}else{
				year = year + "년";
			}
			//월 미상처리
			if(mon.startsWith("9")){
				mon = "";
			}else{
				mon = mon + "월";
			}
			//일 미상처리
			if(day.startsWith("9")){
				day = "";
			}else{
				day = day + "일";
			}
			date = bc + year + "" + mon + "" + day + l;
		}
		
		return date;
	}
	public String getCreator() {
		return creator;
	}
	public void setCreator(String creator) {
		this.creator = creator;
	}
	public String getPublisher() {
		return publisher;
	}
	public void setPublisher(String publisher) {
		this.publisher = publisher;
	}
	public String getPlace() {
		return place;
	}
	public void setPlace(String place) {
		this.place = place;
	}
	public String getBinder() {
		return binder;
	}
	public void setBinder(String binder) {
		this.binder = binder;
	}
	public String getNation() {
		return nation;
	}
	public void setNation(String nation) {
		this.nation = nation;
	}
	public String getLinkUrl() {
		return linkUrl;
	}
	public void setLinkUrl(String linkUrl) {
		this.linkUrl = linkUrl;
	}
	public String getLinkText() {
		return linkText;
	}
	public void setLinkText(String linkText) {
		this.linkText = linkText;
	}
	public String getBiblioExplanation() {
		return biblioExplanation;
	}
	public void setBiblioExplanation(String biblioExplanation) {
		this.biblioExplanation = biblioExplanation;
	}
	public String getIsLeaf() {
		return isLeaf;
	}
	public void setIsLeaf(String isLeaf) {
		this.isLeaf = isLeaf;
	}
	public String getIsText() {
		return isText;
	}
	public void setIsText(String isText) {
		this.isText = isText;
	}
	public String getLevelXml() {
		return levelXml;
	}
	public void setLevelXml(String levelXml) {
		this.levelXml = levelXml;
	}
	public String getRegistedDate() {
		return registedDate;
	}
	public void setRegistedDate(String registedDate) {
		this.registedDate = registedDate;
	}
	public String getRegister() {
		return register;
	}
	public void setRegister(String register) {
		this.register = register;
	}
	public String getModifiedDate() {
		return modifiedDate;
	}
	public void setModifiedDate(String modifiedDate) {
		this.modifiedDate = modifiedDate;
	}
	public String getModifier() {
		return modifier;
	}
	public void setModifier(String modifier) {
		this.modifier = modifier;
	}
	
	public String getLevelText() {
		return levelText;
	}
	public void setLevelText(String levelText) {
		this.levelText = levelText;
	}
	
	public String getExistImage() {
		return existImage;
	}
	public void setExistImage(String existImage) {
		this.existImage = existImage;
	}
	public int getImageCount() {
		return imageCount;
	}
	public void setImageCount(int imageCount) {
		this.imageCount = imageCount;
	}
	
	public String getOtherTypes() {
		return otherTypes;
	}
	public void setOtherTypes(String otherTypes) {
		this.otherTypes = otherTypes;
	}
	
	public int getGisCount() {
		return gisCount;
	}
	public void setGisCount(int gisCount) {
		this.gisCount = gisCount;
	}
	
	public String getDoc_id() {
		return doc_id;
	}
	public void setDoc_id(String docId) {
		doc_id = docId;
	}
	
	public int getPosition() {
		return position;
	}
	public void setPosition(int position) {
		this.position = position;
	}
	
	public int getCount() {
		return count;
	}
	public void setCount(int count) {
		this.count = count;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((levelId == null) ? 0 : levelId.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ItemLevelVO other = (ItemLevelVO) obj;
		if (levelId == null) {
			if (other.levelId != null)
				return false;
		} else if (!levelId.equals(other.levelId))
			return false;
		return true;
	}
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("ItemLevelVo [alternative=");
		builder.append(alternative);
		builder.append(", author=");
		builder.append(author);
		builder.append(", biblioExplanation=");
		builder.append(biblioExplanation);
		builder.append(", binder=");
		builder.append(binder);
		builder.append(", creator=");
		builder.append(creator);
		builder.append(", dates=");
		builder.append(dates);
		builder.append(", form=");
		builder.append(form);
		builder.append(", isLeaf=");
		builder.append(isLeaf);
		builder.append(", isText=");
		builder.append(isText);
		builder.append(", itemInfo=");
		builder.append(itemInfo);
		builder.append(", xmlId=");
		builder.append(xmlId);
		builder.append(", level=");
		builder.append(level);
		builder.append(", levelId=");
		builder.append(levelId);
		builder.append(", levelXml=");
		builder.append(levelXml);
		builder.append(", linkText=");
		builder.append(linkText);
		builder.append(", linkUrl=");
		builder.append(linkUrl);
		builder.append(", mainTitle=");
		builder.append(mainTitle);
		builder.append(", modifiedDate=");
		builder.append(modifiedDate);
		builder.append(", modifier=");
		builder.append(modifier);
		builder.append(", nation=");
		builder.append(nation);
		builder.append(", parentId=");
		builder.append(parentId);
		builder.append(", period=");
		builder.append(period);
		builder.append(", place=");
		builder.append(place);
		builder.append(", publisher=");
		builder.append(publisher);
		builder.append(", reference=");
		builder.append(reference);
		builder.append(", registedDate=");
		builder.append(registedDate);
		builder.append(", register=");
		builder.append(register);
		builder.append(", sequence=");
		builder.append(sequence);
		builder.append(", seriesTitle=");
		builder.append(seriesTitle);
		builder.append(", subjectClass=");
		builder.append(subjectClass);
		builder.append(", types=");
		builder.append(types);
		builder.append("]");
		return builder.toString();
	}
}
